//
//  FollowingViewController.m
//  CareWithFriends
//
//  Created by Versatile Systems, Inc on 11/18/13.
//  Copyright (c) 2013 Muludiang. All rights reserved.
//

#import "FollowingViewController.h"
#import "CWFData.h"

@interface FollowingViewController ()

@end

@implementation FollowingViewController

@synthesize userTable;


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    CWFData *dataObj = [CWFData sharedInstance];
return [[[dataObj getFollowedUsers] valueForKey:@"users"] count ];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"FollowingCell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    CWFData *dataObj = [CWFData sharedInstance];
    [cell.textLabel setText:[NSString stringWithFormat:@"%@ %@", [[[[dataObj getFollowedUsers] valueForKey:@"users"] objectAtIndex:indexPath.row] valueForKey:@"first_name"], [[[[dataObj getFollowedUsers] valueForKey:@"users"] objectAtIndex:indexPath.row] valueForKey:@"last_name"] ]];
    
    

    return cell;
}


-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
